package com.sixth.service.impl;


import com.sixth.dao.MemberDao;
import com.sixth.entity.TbMemberResult;
import com.sixth.service.TbMemberService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @program: self-tui-education
 * @description:
 * @author: 厉泽禄
 * @create: 2022-04-19 21:16
 **/
@Service(value = "tbmemberService")
public class TbMemberServiceImpl implements TbMemberService{
    @Autowired
    private MemberDao memberDao;

    @Override
    public CommonResult queryMemberTypeBang() {
        int value01=memberDao.value(0); //0是会员
        int value02=memberDao.value(1); //1是讲师
        ArrayList<TbMemberResult> results = new ArrayList<>();
        results.add(new TbMemberResult("会员",value01));
        results.add(new TbMemberResult("讲师",value02));
        return new CommonResult(2000,"查询成功",results);
    }
}
